package com.kikt.recyclerview.loadmore

import android.util.Log

/**
 * Created by cjl on 2017/10/27.
 */
val Any.LOGTAG: String
    get() = this.javaClass.simpleName


val Any.logger
    get() = Logger(LOGTAG)

class Logger(val tag: String) {

    companion object {
        var isDebug = true
    }

    fun info(msg: String) {
        if (isDebug) {
            Log.i(tag, msg)
        }
    }

    fun debug(msg: String) {
        if (isDebug) {
            Log.d(tag, msg)
        }
    }

    fun info(any: Any?) {
        if (isDebug) {
            Log.i(tag, any.toString())
        }
    }

}